home *** CD-ROM | disk | FTP | other *** search
- Path: druid.borland.com!usenet
- From: pete@borland.com (Pete Becker)
- Newsgroups: comp.lang.c++
- Subject: Re: RTTI and MSVC 4.0 examples sought
- Date: 8 Mar 1996 18:41:31 GMT
- Organization: Borland International
- Message-ID: <4hpv0r$7sv@druid.borland.com>
- References: <313F912F.39D2@vream.com>
- NNTP-Posting-Host: pbecker.borland.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=ISO-8859-1
- X-Newsreader: WinVN 0.99.5
-
- In article <313F912F.39D2@vream.com>, tnewark@vream.com says...
- >
- >I'm looking for some examples of using RTTI with MSVC 4.0.
- >
- >The problem I'm specifically trying to solve is that I want to implement
- >IsKindOf(Ptr, class) where I return true if a ptr is type class or a
- >subclass of class, and false otherwise.
- >
- >MicroSoft's documentation is very weak on the RTTI subject and type_info
- >class, especially about such things as collating order (what exactly is
- >it?)
-
- #define IsKindOf(Ptr,class) dynamic_cast<class *>(Ptr)
- }
-
- I haven't tried this with MSVC 4.0. However, it should work on any compiler
- that implements RTTI correctly.
-
-